package com.class05.method_more._03valuetransfer;




import java.util.*;


/**
 * @author 尚硅谷-宋红康
 * @create 21:42
 */
public class ValueTransferTest {
    public static void main(String[] args) {
//        1.基本数据类型的局部变量
        int m = 10;
        int n = m;//传递的是数据值
//        System.out.println("n = " + n);

//        2.引用数据类型的局部变量
//        2.1 数组类型
        int[] arr1 = {1, 2, 3, 4, 5};
        int[] arr2 = arr1;//传递的是地址值
        arr2[0] = 10;
        System.out.println("arr1[0] = " + arr1[0]);

        Scanner sc = new Scanner(System.in);
        Arrays.toString(arr1);

        Collection<String> list = new ArrayList<>();

//        Float aFloat = new Float();
//        private Math() {}
//        Math math = new Math();
        Object o = new Object();




//        2.2 对象类型
        Order order1 = new Order();
        order1.orderId = 1001;
        Order order2 = order1;//传递的地址值
        order2.orderId = 1002;
        Order order3 = new Order();
        System.out.println(1 == 4);
        System.out.println(order1.hashCode() == order2.hashCode());
        System.out.println(order1.hashCode() == order3.hashCode());
        System.out.println("order1.orderId = " + order1.orderId);//1002
    }


}

class Order {
    int orderId;
}

